package star.crust.cartspace.framework;

import java.util.ArrayList;

public abstract class CrtBoxing {
	protected ArrayList<CrtMeshPrimitive> meshsPrimitive;
	protected String type;
	protected float vector[];

	/**
	 * Costruttore del volume
	 * @param meshsPrimitive
	 * @param type
	 */
	public CrtBoxing(ArrayList<CrtMeshPrimitive> meshsPrimitive, String type) {
		this.meshsPrimitive = meshsPrimitive;
		this.type=type;
	}
	
	/**
	 * Restituisce la dimensione del volume
	 * @return
	 */
	public abstract float size();

	public float[] getVector()
	{
		return this.vector;
	}

	public void setVector(float[] v)
	{
		this.vector=v;
	}

	/**
	 * Parametro che identifica il tipo di volume ( OBB/AABB)
	 * @return
	 */
	public String getType()
	{
		return this.type;
	}

	public ArrayList<CrtMeshPrimitive> getMesh()
	{
		return this.meshsPrimitive;
	}
	
	public String toString() {
		return String.format("%1$-" + 10 + "s", vector[0])+"\t"+String.format("%1$-" + 10 + "s", vector[1])+"\t"+String.format("%1$-" + 10 + "s", vector[2]);
	}


	// AABB
	public CrtBoxing(CrtMesh meshes) {}
	public abstract double dblsize();

}
